package com.arch.dev.client.vo;

import java.util.Set;

import com.google.gwt.user.client.rpc.IsSerializable;

public class MonthVO implements IsSerializable {

	private int id;

	public int getId() {

		return id;

	}

	public void setId(int id) {

		this.id = id;

		setName(getMonth(id));

	}

	public String getName() {

		return Name;

	}

	public void setName(String name) {

		Name = name;

	}

	public Set<Integer> getDates() {

		return dates;

	}

	public void setDates(Set<Integer> dates) {

		this.dates = dates;

	}

	private String Name;

	public MonthVO() {

	}

	public MonthVO(int id, String name) {

		this.id = id;

		this.Name = name;

	}

	private Set<Integer> dates;

	@Override
	public boolean equals(Object obj) {

		return (getId() == ((MonthVO) obj).getId());

	}

	@Override
	public int hashCode() {

		return 1;

	}

	private String getMonth(int id) {

		String name = "";

		switch (id) {

		case 0:

			name = "January";

			break;

		case 1:

			name = "February";

			break;

		case 2:

			name = "March";

			break;

		case 3:

			name = "April";

			break;

		case 4:

			name = "May";

			break;

		case 5:

			name = "June";

			break;

		case 6:

			name = "July";

			break;

		case 7:

			name = "August";

			break;

		case 8:

			name = "September";

			break;

		case 9:

			name = "October";

			break;

		case 10:

			name = "November";

			break;

		case 11:

			name = "December";

			break;

		}

		return name;

	}

}
